package module.storage.service;

import lombok.extern.slf4j.Slf4j;
import module.storage.context.StorageSourceContext;
import module.storage.convert.StorageSourceConvert;
import module.storage.mapper.StorageSourceMapper;
import module.storage.modul.entity.StorageSource;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 存储源基本信息 Service
 *
 */
@Slf4j
@Service
@CacheConfig(cacheNames = "storageSource")
public class StorageSourceService {

    @Resource
    private StorageSourceMapper storageSourceMapper;

    @Resource
    private StorageSourceService storageSourceService;

    @Resource
    private StorageSourceContext storageSourceContext;

    @Resource
    private StorageSourceConvert storageSourceConvert;

    @Resource
    private StorageSourceConfigService storageSourceConfigService;


    /**
     * 获取所有存储源列表
     *
     * @return 存储源列表
     */
    public List<StorageSource> findAllOrderByOrderNum() {
        return storageSourceMapper.findAllOrderByOrderNum();
    }


    /**
     * 获取所有已启用的存储源列表，按照存储源的排序号排序
     *
     * @return 已启用的存储源列表
     */
    public List<StorageSource> findAllEnableOrderByOrderNum() {
        return storageSourceMapper.findListByEnableOrderByOrderNum();
    }
}
